package battleship;

import java.util.Scanner;
import java.util.Random;

public class Driver {

    public static void main(String[] args) {
        
    	Board board = new Board();
		System.out.println("Welcome to battleship!");
		System.out.print("Please enter player1's name:");
		Scanner scan = new Scanner(System.in); 
		Player1 p1 = new Player1(scan.nextLine(),board);
		p1.init();
		Thread p1Thread = new Thread(p1);
		System.out.print("Please enter player2's name:");
		Player2 p2 = new Player2(scan.nextLine(),board);
		p2.init();
		Thread p2Thread = new Thread(p2);
		System.out.println("Here we go!!! Let's begin!!!");
        System.out.println();
        p1Thread.start();
        p2Thread.start();
        
       
        try {
        	p1Thread.join();
			p2Thread.join();
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        
    }
    
}
